﻿@{
    ViewBag.Title = "Giày dép thời trang";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using System.Text;
@model IEnumerable<EC_ASS.Models.Product>
<div class="container">
    <div class="row">
        <div class="span9">
            <h4>@ViewBag.MSM</h4>
            <hr />
            <div class="row">
                @if (Model.Count() > 0)
                {
                    <ul class="portfolio-list" data-sort-id="portfolio">
                        @foreach (var item in Model)
                        {
                            if (Model.Count() > 0)
                            {
                            <li class="span2 isotope-item">
                                <div class="portfolio-item thumbnail">
                                    <a href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info">
                                        <img alt="" src="@Url.Content("~/" + @item.Picture)" />
                                        <span class="thumb-info-title">
                                            <span class="thumb-info-inner">@item.Name</span>
                                            <span class="thumb-info-type">@item.Price VNĐ</span>
                                        </span>
                                        <span class="thumb-info-action">
                                            <span title="Xem chi tiết" href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info-action-icon"><i class="icon-link"></i></span>
                                        </span>
                                    </a>
                                </div>
                            </li>
                            }
                        }
                    </ul>
                }
                else
                {
                    <div class="alert alert-info" style="margin-left: 30px;">
                        Chưa có sản phẩm nào trong danh mục này.
                    </div>
                }
            </div>
        </div>
        <div class="span3">
            <h4>Liên kết shop</h4>
            <hr />
            <div class="row">
                <div class="span3">
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="250" __idm_id__="790511625">
                        <param name="movie" value="@Url.Content("~/img/ads/ads01.swf")?clickTAG=@Request.RawUrl">
                        <param name="quality" value="high">
                        <param name="wmode" value="transparent">
                        <param name="flashvars" value="clickTAG=@Request.RawUrl">
                        <embed src="@Url.Content("~/img/ads/ads01.swf")" flashvars="clickTAG=@Request.RawUrl" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="260" height="250"></object>
                </div>
                <div class="span3">
                    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="250" __idm_id__="790511625">
                        <param name="movie" value="@Url.Content("~/img/ads/ads02.swf")?clickTAG=@Request.RawUrl">
                        <param name="quality" value="high">
                        <param name="wmode" value="transparent">
                        <param name="flashvars" value="clickTAG=@Request.RawUrl">
                        <embed src="@Url.Content("~/img/ads/ads02.swf")" flashvars="clickTAG=@Request.RawUrl" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="260" height="250"></object>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <hr />
    <div class="row">
        @Html.Partial("_Payment")
    </div>
</div>

@functions {
    string ToUrlName(string name)
    {
        string stFormD = name.Normalize(NormalizationForm.FormD);
        StringBuilder sb = new StringBuilder();
        for (int ich = 0; ich < stFormD.Length; ich++)
        {
            System.Globalization.UnicodeCategory uc = System.Globalization.CharUnicodeInfo.GetUnicodeCategory(stFormD[ich]);
            if (uc != System.Globalization.UnicodeCategory.NonSpacingMark)
            {
                sb.Append(stFormD[ich]);
            }
        }
        sb = sb.Replace('Đ', 'D');
        sb = sb.Replace('đ', 'd');
        return (sb.ToString().Normalize(NormalizationForm.FormD).ToUpperInvariant().Trim().Replace(" ", "-"));
    }
}
